package com.aurora.base.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CheckUtil {

    public static boolean isMobile(String str) {
	Pattern p = null;
	Matcher m = null;
	boolean b = false;
	p = Pattern.compile("^[1][3,4,5,8,7][0-9]{9}$"); // 验证手机号
	m = p.matcher(str);
	b = m.matches();
	return b;
    }

    public static boolean email(String str) {
	Pattern p = null;
	Matcher m = null;
	boolean b = false;
	p = Pattern
		.compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"); // 验证手机号
	m = p.matcher(str);
	b = m.matches();
	return b;
    }
}
